package com.app.mymusic.adapter;

import com.app.mymusic.R;
import com.app.mymusic.model.Songs;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2016-12-8.
 */

public abstract class ChartsAdapter extends BaseQuickAdapter<Songs.Song_list,BaseViewHolder> {
//    private Context context;

    public ChartsAdapter(int layoutResId, List<Songs.Song_list> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(final BaseViewHolder baseViewHolder, final Songs.Song_list song) {
       /* Picasso.with(context).load(Uri.parse(song.getPic_small())).into(new Target() {
            @Override
            public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
                baseViewHolder.setImageBitmap(R.id.charts_img,bitmap)
                .setText(R.id.song_name,song.getTitle())
                .setText(R.id.song_album,song.getAlbum_title());
            }

            @Override
            public void onBitmapFailed(Drawable errorDrawable) {

            }

            @Override
            public void onPrepareLoad(Drawable placeHolderDrawable) {

            }
        });*/
        baseViewHolder
                .setText(R.id.song_name,song.getTitle())
                .setText(R.id.song_album,song.getAlbum_title());
        getBitmap(song,baseViewHolder);
    }

    public abstract void  getBitmap(Songs.Song_list song,BaseViewHolder baseViewHolder) ;

}
